package com.fh.common.exception;


import com.fh.common.util.StringUtils;

/**
 * @author Qiu,Junda
 * @date 2019年3月22日
 * @description 数据校验
 */
public class Assert {

    public static void isBlank(String str, String message) {
        if (StringUtils.isEmpty(str)) {
            throw new SelfDefinedException(message);
        }
    }

    public static void isNull(Object object, String message) {
        if (object == null) {
            throw new SelfDefinedException(message);
        }
    }
    
    public static void isTrue(boolean booleanTag,String message) {
    	if(booleanTag) {
    		throw new SelfDefinedException(message);
    	}
    }
    
    public static void isFalse(boolean booleanTag,String message) {
    	if(!booleanTag) {
    		throw new SelfDefinedException(message);
    	}
    }
    
    public static void error(String message) {
    	throw new SelfDefinedException(message);
    }
    
    
}
